<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/user/common.jsp"%>
<%@ page import="com.bci.pwtz.common.util.SpringUtil" %>
<%@ page import="com.bci.pwtz.service.ConfigService" %>
<%@ page import="com.bci.pwtz.mysql.model.Dygt" %>
<%@ page import="com.bci.pwtz.service.DygtService" %>
<%@ page import="com.bci.pwtz.mysql.model.Dyxl" %>
<%@ page import="com.bci.pwtz.service.DyxlService" %>
<%@ page import="com.bci.pwtz.service.KzsxsbzpService" %>
<%@ page import="com.bci.pwtz.mysql.model.Kzsxsbzp" %>
<%@ page import="java.util.List" %>
<%@ page import="com.bci.pwtz.service.PdbyqService" %>
<%@ page import="com.bci.pwtz.service.ZsbyqService" %>
<%
Long companyId=null;
if(user!=null){
    companyId=user.getLastCompanyId();
}
ConfigService configService=(ConfigService)SpringUtil.getBean("configService");
String picpath=configService.getConfigByKey("DevicePICPath");
String deviceid=request.getParameter("deviceid");
//deviceid="6b1f1628-946d-4619-b2a1-906b39f9a382";
DygtService service=(DygtService)SpringUtil.getBean("dygtService");
Dygt device=service.load(deviceid);
DyxlService lineService=(DyxlService)SpringUtil.getBean("dyxlService");
Dyxl line=lineService.load(device.getLinecode());
String linecode="";
String linename="";
String transformercode="";
String transformername="";
String dbyqtype="";
String byqname="";
boolean isPhysicaltower=false;
if(!device.getDeviceid().equals(device.getPhysicaltowercode())){
	isPhysicaltower=true;
}
if(line!=null){
    linecode=line.getDeviceid();
    linename=line.getDevicename();
    transformercode=line.getTransformercode();
    if(line.getDevicetype()==1){
        dbyqtype="pdbyq";
        byqname="配电变压器";
        PdbyqService pdService=(PdbyqService)SpringUtil.getBean("pdbyqService");
        transformername=pdService.load(transformercode).getDevicename();
    }else{
        dbyqtype="zsbyq";
        byqname="柱上变压器";
        ZsbyqService zsService=(ZsbyqService)SpringUtil.getBean("zsbyqService");
        transformername=zsService.load(transformercode).getDevicename();
    }
}
KzsxsbzpService kzsxsbzpService=(KzsxsbzpService)SpringUtil.getBean("kzsxsbzpService");
List<Kzsxsbzp> kzsxsbzplist=kzsxsbzpService.selectDeviceList(companyId, deviceid);
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据-低压杆塔</title>
<link href="<%=basePath %>user/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>user/css/llcss.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/toolutils.js"></script>
<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>js/ajaxfileupload.js"></script>
<script type="text/javascript">
var companyId=<%=companyId%>;
var picpath='<%=picpath%>';
var thisDeviceid='<%=device.getDeviceid()%>';
var deviceid='<%=line.getDeviceid()%>';
var byqtype=<%=line.getDevicetype()%>;
var transformercode='<%=line.getTransformercode()%>';
var model = '<%=device.getModel()%>';
var productionfactory = '<%=device.getProductionfactory()%>';
var predevicecode = '<%=device.getPredevicecode()%>';
var currentDeviceId='<%=device.getDeviceid()%>';
var towerheight = '<%=device.getTowerheight()%>';
var physicaltowercode = '<%=device.getPhysicaltowercode()%>';
var transformername='<%=transformername%>';
var isPhysicaltower=<%=isPhysicaltower%>;
</script>
<script type="text/javascript" src="<%=basePath %>user/d/js/dygtadd.js"></script>
<script type="text/javascript">
function selectLoad(){
	setDefault('predevicetype','<%=device.getPredevicetype()%>');
	predeviceStart(companyId);
	setDefault('operationstate','<%=device.getOperationstate()%>');
	setDefault('physicaltowercode','<%=device.getPhysicaltowercode()%>');
	setDefault('towernature','<%=device.getTowernature()%>');
	setDefault('equipmentstate','<%=device.getEquipmentstate()%>');
	setTimeout(function(){
		setDefault('model','<%=device.getModel()%>');
		setDefault('productionfactory','<%=device.getProductionfactory()%>');
	},100);
	setDefault('isterminal','<%=device.getIsterminal()%>');
	setDefault('towermaterial','<%=device.getTowermaterial()%>');
	setDefault('crossarmmaterial','<%=device.getCrossarmmaterial()%>');
	setDefault('towerheight','<%=device.getTowerheight()%>');
	setDefault('basicform','<%=device.getBasicform()%>');
	setDefault('assetsnature','<%=device.getAssetsnature()%>');
	setDefault('voltagelevel','<%=device.getVoltagelevel()%>');
	<%-- setTimeout(function(){
		predeviceStart(companyId);
		setTimeout(function(){
			setDefault('predevicecode','<%=device.getPredevicecode()%>');
		},100);
	},100); --%>
}
</script>
</head>
<body bgcolor="white" onload="selectLoad()">
	<%@ include file="/user/head.jsp"%>
	<!-- main_begin -->
	<div class="pwsj_cont_box">
	<%@ include file="/user/left.jsp"%>
	<!-- 右侧内容_begin -->
	<%if(device!=null) {%>
	<form id="form">
		<div class="pwsj_cont_right_box" scroll="no">
		<!-- 柱上变压器_begin -->
		<div class="pwsj_right_byq" scroll="no">
			<div class="pwsj_right_byq_position" style="margin-bottom:3px;">
				<a href="<%=basePath %>user/m/index.jsp" class="position">配网数据</a>&gt;
				<a href="<%=basePath %>user/d/<%=dbyqtype %>list.jsp" class="position"><%=byqname %></a>&gt;
				<a href="<%=basePath %>user/d/dyxllist.jsp?deviceid=<%=transformercode %>&devicetype=<%=line.getDevicetype() %>" class="position">低压线路</a>&gt;
				<a  class="position">修改低压杆塔</a>
				<a class="right"  href="<%=basePath%>user/d/dygtlist.jsp?deviceid=<%=device.getLinecode()%>&t=<%=System.currentTimeMillis() %>">返回</a><a class="right"  onclick="edite()">保存</a>
			</div>
			<!-- 运行参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">运行参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>设备名称：</span><input class="text" type="hidden" id="deviceid" name="deviceid" value="<%=device.getDeviceid()%>"/><input class="text" type="text" id="devicename" name="devicename" maxlength="100" value="<%=device.getDevicename()%>"/><em style="color:red;"> *</em></li>
						<li class="argument_cont_li"><span>运行编号：</span><input class="text" type="text" id="devicenumber" name="devicenumber" value="<%=device.getDevicenumber()%>"/></li>
						<li class="argument_cont_li"><span>所属线路名称：</span><input class="text" type="hidden" name="linecode" value="<%=device.getLinecode()%>"/><input readonly="readonly" class="text" type="text" value="<%=linename%>"/><!-- <em style="color:red;"> *</em> --></li>						
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<input class="text" type="hidden" id="indexnumber" name="indexnumber" value="<%=device.getIndexnumber()%>"/>
							<span>关联杆塔：</span>
							<select class="select_down" id="physicaltowercode" name="physicaltowercode">
								<option value="0">--请选择--</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li">
							<span>上联设备类型：</span>
							<select class="select_down" id="predevicetype" name="predevicetype">
								<option value="4">低压杆塔</option>
								<option value="16">低压配电箱</option>
								<option value="17">低压电缆分接箱</option>
								<%if(dbyqtype.equals("pdbyq")){%>
									<option value="1">配电变压器</option>
								<%}else{%>
									<option value="2">柱上变压器</option>
								<%}%>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>			
						<li class="argument_cont_li">
							<span>上联设备：</span>
							<select class="select_down" id="predevicecode" name="predevicecode">
								<option value="0">--请选择--</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>所属地市：</span><input class="text" type="text" id="localcity" name="localcity" value="<%=device.getLocalcity()%>"/><!-- <em style="color:red;"> *</em> --></li>	
						<li class="argument_cont_li"><span>运维单位：</span><input class="text" type="text" id="operationunit" name="operationunit" value="<%=device.getOperationunit()%>"/><!-- <em style="color:red;"> *</em> --></li>						
						<li class="argument_cont_li"><span>维护班组：</span><input class="text" type="text" id="maintenanceteam" name="maintenanceteam" value="<%=device.getMaintenanceteam()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>电压等级：</span>
						<%-- <input class="text" type="text" id="voltagelevel" name="voltagelevel" value="<%=device.getVoltagelevel()%>"/> --%>
						<select class="select_down" name="voltagelevel" id="voltagelevel">
							<option value="380v">380v</option>
							<option value="220v">220v</option>
						</select>
						<!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li" style="position:relative;"><span>投运日期：</span><input class="text" type="text" id="commissioningdate" value="<%=device.getCommissioningdate()%>"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="commissioningdate"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>杆塔性质：</span>
							<select class="select_down" id="towernature" name="towernature">  
								<option value ="直线">直线</option>  
								<option value ="耐张">耐张</option>			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>档距：</span><input class="text" type="text" id="span" name="span" value="<%=device.getSpan()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<%-- <li class="argument_cont_li"><span>转角方向：</span><input class="text" type="text" name="rotationdirection" value="<%=device.getRotationdirection()%>"/></li> --%>					
						<%-- <li class="argument_cont_li"><span>转角度数：</span><input class="text" type="text" name="rotationdegree" value="<%=device.getRotationdegree()%>"/></li> --%>
						<li class="argument_cont_li">
							<span>是否终端：</span>
							<select class="select_down" id="isterminal" name="isterminal">
								<option value="否">否</option>
								<option value="是">是</option>
							</select>
						</li>
						<li class="argument_cont_li">
							<span>运行状态：</span>
							<select class="select_down" id="operationstate" name="operationstate">  
								<option value ="正常">正常</option>  
								<option value ="异常">异常</option>
								<option value ="故障">故障</option>
								<option value ="缺陷">缺陷</option> 			
							</select>
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<%-- <li class="argument_cont_li"><span>是否同杆架设：</span><input class="text" type="text" value="<%=device.getIssametower()%>" readonly="readonly" id="issametower"/><input class="text" type="text" value="<%=device.getIssametower()%>" hidden="true" id="issametower1" name="issametower"/></li> --%>				
						<%-- <li class="argument_cont_li"><span>同杆架设回路数：</span><input class="text" type="number" value="<%=device.getSametowernumber()%>" readonly="readonly" id="sametowernumber"/><input class="text" type="number" value="<%=device.getSametowernumber()%>" hidden="true" id="sametowernumber1" name="sametowernumber"/></li> --%>
						<li class="argument_cont_li">
							<span>设备状态：</span>
							<select class="select_down" id="equipmentstate" name="equipmentstate">  
								<option value ="在运">在运</option>  
								<option value ="未投运">未投运</option>
								<option value ="退役">退役</option>
								<option value ="现场留用">现场留用</option>
								<option value ="库存备用">库存备用</option>
								<option value ="待报废">待报废</option>
								<option value ="报废">报废</option>
								<option value ="正常">正常</option>
								<option value ="异常">异常</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 运行参数_end -->

			<!-- 物理参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">物理参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>型号：</span>
							<select class="select_down" id="model" name="model">  
								<option value ="">--型号--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('型号',4002,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li"><span>生产厂家：</span>
							<select class="select_down" id="productionfactory" name="productionfactory">  
								<option value ="">--生产厂家--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('生产厂家',4003,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li" style="position:relative;"><span>出厂日期：</span><input class="text" type="text"  value="<%=device.getFactorydate()%>" placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="factorydate"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /></li>							
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>出厂编号：</span><input class="text" type="text" name="serialnumber" value="<%=device.getSerialnumber()%>"/></li>
						<li class="argument_cont_li">
							<span>杆塔材质：</span>
							<select class="select_down" id="towermaterial" name="towermaterial">
								<option value="角钢塔">角钢塔</option>
								<option value="钢管塔">钢管塔</option>
								<option value="钢管杆">钢管杆</option>  
								<option value ="水泥杆">水泥杆</option>  
								<option value ="木杆">木杆</option>				
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li">
							<span>横担材质：</span>
							<select class="select_down" id="crossarmmaterial" name="crossarmmaterial">
								<option value="铁">铁</option>
								<option value="瓷">瓷</option>
								<option value="木头">木头</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>							
						<div class="clear"></div>
					</ul>	
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>杆高：</span>
							<select class="select_down" id="towerheight" name="towerheight">
								<option value="0">--请选择--</option>
							</select>
							<a title="手动输入" onclick="dictionaryadd('杆高',4001,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li">
						<span>基础形式：</span>
						<select class="select_down" id="basicform" name="basicform">
							<option value="钢筋混凝土">钢筋混凝土</option>
							<option value="素混">素混</option>
							<option value="卡盘式基础">卡盘式基础</option>
							<option value="阶梯型基础">阶梯型基础</option>
							<option value="掏挖基础">掏挖基础</option>
							<option value="岩石锚杆基础">岩石锚杆基础</option>
							<option value="金属基础">金属基础</option>
							<option value="联合基础">联合基础</option>
							<option value="灌注桩基础">灌注桩基础</option>
							<option value="斜插板式基础">斜插板式基础</option>
							<option value="电杆基础">电杆基础</option>
							<option value="水泥杆基础">水泥杆基础</option>
							<option value="土壤技术">土壤技术</option>
							<option value="嵌入式">嵌入式</option>
							<option value="其他">其他</option>
						</select>
						</li>
						<li class="argument_cont_li"><span>接地电阻：</span><input class="text" type="text" id="groundingresistance" name="groundingresistance" value="<%=device.getGroundingresistance()%>"/></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>施工单位：</span><input class="text" type="text" name="constructionunit" value="<%=device.getConstructionunit()%>"/></li>
						<li class="argument_cont_li"><span>备注：</span><input class="text" type="text" name="note" value="<%=device.getNote()%>"/></li>
						<div class="clear"></div>
					</ul>		
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 物理参数_end -->

			<!-- 资产参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">资产参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>资产性质：</span>
							<select class="select_down" name="assetsnature" id="assetsnature">  
								<option value ="用户">用户</option>  
								<option value ="公司">公司</option>
								<option value ="子公司">子公司</option>
								<option value ="省(直辖市、自治区)">省(直辖市、自治区)</option>				
							</select>
						</li>
						<li class="argument_cont_li"><span>资产单位：</span><input class="text" type="text" name="assetunit" value="<%=device.getAssetunit()%>"/></li>
						<li class="argument_cont_li"><span>资产编号：</span><input class="text" type="text" id="assetnumber" name="assetnumber" value="<%=device.getAssetnumber()%>"/><!-- <em style="color:red;"> *</em> --></li>	
						<div class="clear"></div>
					</ul>					
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 资产参数_end -->

			<!-- 扩展属性_begin -->
			<div class="argument_box">
				<!-- 设备图片_begin -->
				<div class="kzsx_big_img" style="display:none;">
					<img src="" onload = "autoSize(this,400)" alt="" />			
				</div>
				<!-- <img class="kzsx_big_img_close" src="images/add_facility_close.png" alt="" /> -->
				<!-- 设备图片_end -->

				<!-- 标题-begin -->
				<div class="argument_title">
					<p class="title">扩展属性</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 标题-end -->
				<!-- 扩展属性内容_begin -->
				<div class="argument_cont_box" style="border-bottom:1px solid #dedede;">
					<!-- 扩展属性左侧_begin -->
					<div class="kzsx_cont_leftbox">
						<div class="add_pic">
							照片信息:
							<select class="select_down" style="width:80px; height:25px; margin-right:10px;" id="pictype">  
								<option style="text-indent:5px;" value="">--请选择--</option>
							</select>
							<!-- <input type="text" id="kzsx_add_pic_text" class="text" placeholder="请选择图片" />
							<input type="button" class="add_pic_btn" value="浏览" onclick="document.getElementById('picfile').click();" /> -->
							<input type="file" id="picfile" name="picfile"/>
							<input type="button" value="上传" onclick="return uploadPic()"/>
						</div>
						<!-- 图片动画_begin -->
						<div class="img_flash_box">
							<div class="left_btn"><img src="<%=basePath %>user/images/btn_left.png" /></div>
							<!-- 图片展示_begin -->
							<div class="center">
								<div class="inner_box" id="inner_box">
									<%
									
									    for(Kzsxsbzp kzsxsbzp:kzsxsbzplist){
									%>
									<div class="img_p">
										<input class="pid" type="hidden" value="<%=kzsxsbzp.getId() %>" />
										<img class="small_pic" src="<%=basePath+"Attachment/"+user.getLastCompanyId()+"/DevicePIC/"+kzsxsbzp.getPhotoname().substring(kzsxsbzp.getPhotoname().indexOf("_")+1) %>" alt="" />
										<img class="img_del" onclick="imgdel(this)" src="<%=basePath%>user/images/add_members_close.png" />
										<p><%=kzsxsbzp.getPhotoname().substring(0,kzsxsbzp.getPhotoname().indexOf("_")) %></p>
									</div>
									<%
										} 
									%>
									<div class="clear" id="clear"></div>
								</div>
							</div>
							<!-- 图片展示_begin -->
							<div class="right_btn"><img src="<%=basePath %>user/images/btn_right.png"/></div>
							<div class="clear"></div><!-- 清除左右浮动 -->
						</div>
						<!-- 图片动画_end -->
						<!-- <div class="ts">温馨提示：单击缩略图即可放大，再次单击关闭放映。</div> -->
					</div>
					<!-- 扩展属性左侧_end -->

					<!-- 扩展属性右侧_begin -->
					<div class="kzsx_cont_rightbox">
						<div class="right_title">
							设备空间信息：
							<p><span>经度：</span><input class="text" type="text" name="longitude" value="<%=device.getLongitude()%>"/></p>
							<p><span>纬度：</span><input class="text" type="text" name="latitude" value="<%=device.getLatitude()%>"/></p>
							<p><span>高度：</span><input class="text" type="text" name="altitude" value="<%=device.getAltitude()%>"/></p>
						</div>
					</div>
					<!-- 扩展属性右侧_end -->
					<div class="clear"></div>
				</div>
				<!-- 扩展属性内容_end -->
			</div>
			<!-- 扩展属性_end -->
		</div>	
		<!-- 柱上变压器_end -->		
	</div>
	</form>
	<%}else{ %>
	<h4>设备id错误</h4>
	<%} %>
	<!-- 右侧内容_end -->
	<div class="clear"></div><!-- 清除左右浮动 -->
	</div>
	<!-- main_end -->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>